export class BStorage {
	protected static _prefix = '';
	protected static getKey(key: string) {
		return this._prefix + key;
	}

	static set(key: string, data: any) {
		window.localStorage.setItem(this.getKey(key), JSON.stringify(data));
	}

	static get<T>(key: string) {
		const data = window.localStorage.getItem(this.getKey(key));
		return data ? (JSON.parse(data) as T) : null;
	}
}
